<?php

    // template for sexy popup: http://patleguenbatard.free.fr/vid/bouteille.html
    // use this: http://stackoverflow.com/questions/3405059/how-to-show-youtube-video-thumbnails

        //Include "app/persistance/requete.php";

	$listeVideo = getAllVideos();

        if($listeVideo != null)
        {
            foreach($listeVideo as $video)
            {

                echo "<br />";
                ?>
                <a
                    title="PATLEGUEN.COM"
                   <?php echo "href=\"http://www.youtube.com/v/{$video["LinkToYoutube"]}?autoplay=1&rel=0&enablejsapi=1&playerapiid=ytplayer\""; ?>
                    rel="#voverlay">

                    <img
                     <?php   echo "alt=\"PATLEGUEN.COM\" src=\"http://i1.ytimg.com/vi/{$video["LinkToYoutube"]}/default.jpg\""; ?>
                        />

                    <?php echo "{$video["Location"]}"; ?><?php echo " - id={$video["LinkToYoutube"]}"; ?>

                    <span></span>
                </a>

                <form method="POST" action="index.php?p=16112006">
                    <input type="hidden"
                           name="<?php if($video["IsDisplayed"]) { echo "disable"; } else { echo "activate"; }  ?>"
                           value="<?php echo "{$video["LinkToYoutube"]}"; ?>"
                           />
                    <input type="submit"
                           value="<?php if($video["IsDisplayed"]) { echo "Desactiver la video"; } else { echo "Activer la video"; }  ?>"
                           />
                </form>

                <form
                    method="POST"
                    action="index.php?p=16112006">

                    <input type="hidden"
                           name="updateLocationId"
                           value="<?php echo "{$video["LinkToYoutube"]}"; ?>"
                           />

                    <input type="text"
                           name="updateLocationValue"
                           value="<?php echo "{$video["Location"]}"; ?>"
                           size="78"
                           maxlength="300"
                           />

                    <input type="submit"
                           value="Modifier le lieu de la video"
                           />
                </form>

        <br />
    <?php  } ?> <br />
<?php   } ?>